-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
show patch coverage only for changed files, and don't show indirect changed files #60
Conversation
Codecov Report
@@ Coverage Diff @@
## main #60 +/- ##
==========================================
- Coverage 98.61% 98.60% -0.01%
==========================================
Files 357 357
Lines 25943 25967 +24
==========================================
+ Hits 25584 25606 +22
- Misses 359 361 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -464,11 +467,13 @@ async def do_write_section(self, comparison, diff, changes, links, behind_by=Non | |||
head_report = comparison.head.report | |||
if base_report is None: | |||
base_report = Report() | |||
hide_project_coverage = self.settings.get("hide_project_coverage", False) | |||
metrics = get_metrics_method(hide_project_coverage) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] I think make_metrics_fn
would be a better name than metrics
return "".join(("|", coverage)) | ||
|
||
|
||
def get_metrics_method(hide_project_coverage): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[very nit] I think that technically both make_patch_only_metrics
and make_metrics
are functions, not methods
@@ -116,6 +116,53 @@ def make_metrics(before, after, relative, show_complexity, yaml): | |||
return "".join(("|", coverage, complexity, icon)) | |||
|
|||
|
|||
def make_patch_only_metrics(before, after, relative, show_complexity, yaml): | |||
if after is None: | |||
# e.g. missing flags |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for these helpful comments
We want to show patch coverage only in the changed files table, and hide any indirect changed files
Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.